// 智能体基础接口
export interface Agent {
  id: string;
  name: string;
  description?: string;
  author: string;
  version: string;
  category: string;
  tags: string[];
  shareUrl: string;
  config?: Record<string, any>;
  usage?: string;
  createdAt: string;
  updatedAt: string;
}

// 创建智能体输入类型
export interface CreateAgentInput {
  name: string;
  description?: string;
  author: string;
  version: string;
  category: string;
  tags: string[];
  shareUrl: string;
  config?: Record<string, any>;
  usage?: string;
}

// 更新智能体输入类型
export interface UpdateAgentInput {
  name?: string;
  description?: string;
  author?: string;
  version?: string;
  category?: string;
  tags?: string[];
  shareUrl?: string;
  config?: Record<string, any>;
  usage?: string;
}

// API响应基础接口
export interface ApiResponse<T = any> {
  success: boolean;
  data?: T;
  message?: string;
  error?: string;
}

// 分页查询参数
export interface PaginationQuery {
  page?: number;
  limit?: number;
  category?: string;
  search?: string;
  tags?: string[];
}

// 分页响应数据
export interface PaginatedResponse<T> {
  items: T[];
  total: number;
  page: number;
  limit: number;
  totalPages: number;
}

// 文件操作结果
export interface FileOperationResult {
  success: boolean;
  message?: string;
  error?: string;
  data?: any;
}

// 智能体统计信息
export interface AgentStats {
  total: number;
  categories: Record<string, number>;
  tags: Record<string, number>;
  recentlyAdded: number;
}

// 错误类型
export interface AppError extends Error {
  statusCode?: number;
  code?: string;
}

// 配置接口
export interface ServerConfig {
  port: number;
  dataPath: string;
  backupPath: string;
  maxFileSize: number;
  allowedOrigins: string[];
  logLevel: 'error' | 'warn' | 'info' | 'debug';
}

// 日志级别
export type LogLevel = 'error' | 'warn' | 'info' | 'debug';

// HTTP方法类型
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';

// 智能体排序字段
export type AgentSortField = 'createdAt' | 'updatedAt' | 'name' | 'author';

// 排序方向
export type SortDirection = 'asc' | 'desc';